//
//  OxModel.h
//  project
//
//  Created by 黄建华 on 2018/2/6.
//  Copyright © 2018年 黄建华. All rights reserved.
//

#import <Foundation/Foundation.h>
// 每次血氧模型
@interface oxSubModel : NSObject
@property (nonatomic, assign) NSInteger count;        // 用分钟表示
@property (nonatomic, assign) NSInteger countMins;    // 分钟
@property (nonatomic, assign) NSInteger oxValue;      // 血氧值
@property (nonatomic, strong) NSString  *updateTime; // 按count计算15分钟的间隔对应时间

@end

@interface OxModel : NSObject
@property (nonatomic, strong) NSString *user_id;
@property (nonatomic, strong) NSString *mac;
@property (nonatomic, strong) NSString *dateString;
@property (nonatomic, assign) BOOL     isSaveAllDay;   // 是否保存了全天

@property (nonatomic, assign) NSInteger dayOfWeek;
@property (nonatomic, assign) NSInteger dayOfMonth;
@property (nonatomic, assign) NSInteger weekCount;     // 当前星期
@property (nonatomic, assign) NSInteger monthCount;    // 当前月份
@property (nonatomic, assign) NSInteger yearCount;     // 当前年份
// 血氧
@property (nonatomic, assign) NSInteger      oxAve;            // 平均血氧
@property (nonatomic, assign) NSInteger      oxMax;            // 最高血氧
@property (nonatomic, assign) NSInteger      oxMin;            // 最小血氧
@property (nonatomic, strong) NSMutableArray *oxsuArrayAuto;   // 每天血氧检测数组

@property (nonatomic, strong) NSString *detailData;    // 详细数据

+ (OxModel *)initWithDate:(NSDate *)date;
+ (OxModel *)getOxModelFromDB;
+ (OxModel *)getOxModelFromDBWith:(NSDate *)date;
+ (OxModel *)getOxModelFromDBWithDayString:(NSString *)string;
- (void)     updateToDBSafely;

// 手动同步完之后 血氧
+ (void)updateCheckOX;
- (void)updateRealOXData:(NSInteger)OX;
- (void)updateRealOXEnd:(NSArray *)oxArray;
//同步下载数据需要的
- (void)saveToDBByDownload;

@end

